package com.ly.work.zk;

public class SingleMain {
    public static void main(String[] args) {
        for (int i = 0; i< 3 ; i++){
            //创建线程访问懒汉
            new Thread(()->{
                System.out.println(Thread.currentThread().getName()+"正在访问+++");
                LazySingle.getLazySingle();
            }).start();
        }

        for (int i = 0; i < 3 ; i++) {
            //创建线程访问饿汉
            new Thread(()->{
                System.out.println(Thread.currentThread().getName()+"正在访问");
                HungerSingle.getHungerSingle();
            }).start();
        }
    }
}
